/ Assembly List / LJCDBClientLib / DataManager / Delete

Namespace - LJCDBClientLib


Parameters
keyColumns - The record containing the key field values.
filters - The filter values.

Syntax

C#
public Void Delete(DbColumns keyColumns, DbFilters filters = null)

Deletes the records with the specified key values. (DE)

Remarks

Parameters

keyColumns
This parameter defines the values to be used in the SQL where clause. It is only used if the 'filters' parameter is null.
The values are separated with the 'AND' operator.

filters
This parameter defines the values to be used in the SQL where clause. If it is defined, then the keyColumns parameter is not used.
The 'filters' object can define a complex where clause including combinations of 'AND' and 'OR' operators.

Creates a "Delete" DbRequest object, which is available in the Request property. The request object is passed to the ExecuteRequest() method.

Method Graph

All methods are in LJCDBMessage.DbCommon.

RequestKeys(keyColumns)
CreateKeyColumn(keyColumn)

Example

C#
// This is an example of the Person Manager code that would access the
// DataManager Delete() method. The supporting class code is listed at
// the DataManager class level.

using LJCNetCommon;
using LJCDBMessage;

/// <summary>Provides Person specific data manipulation methods.</summary>
public class PersonManager
{
  /// <summary>Deletes a record from the database.</summary>
  /// <param name="keyObject">The key record object.</param>
  /// <param name="filters">The filter values.</param>
  public void Delete(Person keyObject, DbFilters filters = null)
  {
    mDataManager.Delete(keyObject, filters);
    AffectedCount = mDataManager.AffectedCount;
    SQLStatement = mDataManager.SQLStatement;
  }
}

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.